package com.ruoyi.web.controller.pc.points;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.page.PageUtils;
import com.ruoyi.web.domain.UcMyFlow;
import com.ruoyi.web.domain.vo.QueryVo;
import com.ruoyi.web.mapper.UcMyFlowMapper;
import com.ruoyi.web.service.IPoiApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/points/poiApplyList")
public class PoiApplyListController extends BaseController {

    @Autowired
    private IPoiApplyService poiApplyService;

    @Autowired
    private UcMyFlowMapper ucMyFlowMapper;


    @PreAuthorize("@ss.hasPermi('points:poiApplyList:list')")
    @GetMapping("/list")
    public TableDataInfo list(QueryVo queryVo) {
        PageUtils page = poiApplyService.listByPage(queryVo);
        return getDataTable(page);
    }


    @RequestMapping("/searchUcMyFlow/{applyId}")
    public AjaxResult searchUcMyFlow(@PathVariable("applyId") Long applyId){

        Map<String,Object> map = new HashMap<>();
        map.put("applyId",applyId);
        List<UcMyFlow> myFlows = ucMyFlowMapper.selectByApply(map);

        return success(myFlows);
    }


}

